How Linux Works by Brian Ward
Author:Brian Ward
Language: eng
Format: mobi, epub
Tags: COMPUTERS / Operating Systems / Linux
ISBN: 9781593270889
Publisher: No Starch Press
Published: 2009-08-20T03:00:00+00:00
badmath.o(.text+0x28): undefined reference to 'sin'
badmath.o(.text+0x36): undefined reference to 'pow'
The most important parts of these error messages are in bold. When the linker program examined the badmath.o object file, it could not find the math functions that appear in bold, and as a consequence, it could not create the executable. In this particular case, you might suspect that you forgot the math library because the missing functions refer to mathematical operations (sine and exponentiation).
Note
Undefined references do not always mean that you're missing a library. One of the program's object files could be missing in the link command. It's usually easy to differentiate between library functions and functions in your object files, though.
To fix this problem, you must first find the math library and then use the compiler's -l option to link against the library. As with include files, libraries are scattered throughout the system (/usr/lib is the system default location), though most libraries reside in a subdirectory named lib. For the preceding example, the math library file is libm.a (in /usr/lib), so the library name is m. Putting it all together, you would link the program like this:
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7772)
Filmora Efficient Editing by Alexander Zacharias(5868)
The Infinite Retina by Robert Scoble Irena Cronin(5339)
Learn Wireshark - Fundamentals of Wireshark. by Lisa Bock(4019)
Linux Device Driver Development Cookbook by Rodolfo Giometti(3940)
Edit Like a Pro with iMovie by Regit(3469)
Linux Administration Best Practices by Scott Alan Miller(2864)
Linux Command Line and Shell Scripting Techniques by Vedran Dakic & Jasmin Redzepagic(2840)
MCSA Windows Server 2016 Study Guide: Exam 70-740 by William Panek(2529)
Mastering PowerShell Scripting - Fourth Edition by Chris Dent(2441)
Docker on Windows by Stoneman Elton(2323)
Kali Linux - An Ethical Hacker's Cookbook: End-to-end penetration testing solutions by Sharma Himanshu(2317)
Creative Projects for Rust Programmers by Carlo Milanesi(2286)
Hands-On AWS Penetration Testing with Kali Linux by Karl Gilbert(2115)
Hands-On Linux for Architects by Denis Salamanca(2056)
Programming in C (4th Edition) (Developer's Library) by Stephen G. Kochan(2012)
Computers For Seniors For Dummies by Nancy C. Muir(2009)
The Old New Thing by Raymond Chen(1943)
Linux Kernel Debugging by Kaiwan N Billimoria(1769)
